<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2017/12/21
 * Time: 09:39
 */

namespace App\Http\Traits;

use Illuminate\Http\Request;

trait UserTrait
{
    use BaseTrait;

    /**
     *获取用户openid的码
     * @var array|string
     */
    protected $code;

    /**
     * 用户微信昵称
     * @var array|string
     */
    protected $nickName;

    /**
     * 用户微信性别
     * @var array|string
     */
    protected $gender;

    /**
     * 用户微信语言
     * @var array|string
     */
    protected $language;

    /**
     * 用户微信城市
     * @var array|string
     */
    protected $city;

    /**
     * 用户微信省
     * @var array|string
     */
    protected $province;

    /**
     * 用户微信国家
     * @var array|string
     */
    protected $country;

    /**
     * 用户微信头像地址
     * @var array|string
     */
    protected $avatarUrl;

    // 登录者的loginSession
    protected $loginSession;

    // 咖啡馆ID
    protected $cafe_id;

    // 用户是否对咖啡馆添加喜欢
    protected $is_follow;
    // 用户来源的合作者ID
    protected $partner_id;
    // 用户ID
    protected $user_id;
    // 分页大小
    protected $limit;

    // 用户昵称
    protected $nickname;
    // 用户手机号
    protected $mobile;

    // 用户ID
    protected $id;
    // 权限列表json字符串
    protected $role_list;
    // 小程序路径
    protected $path;
    // 菜单ID字符串
    protected $menu_id_str;

    // 合作者key
    protected $key;
    // 小程序页面
    protected $page;
    // 小程序码参数
    protected $scene;
    // 代金券ID
    protected $cash_coupon_id;
    // 城市ID
    protected $city_id;
    // 标签ID
    protected $mark_id;
    // 开始日期
    protected $start_date;
    // 结束日期
    protected $end_date;
    // 动态ID
    protected $dynamic_id;

    public function __construct(Request $request)
    {
        $this->code = $request->input('code', '');

        $this->nickName = $request->input('nickName', '');

        $this->gender = $request->input('gender', '');

        $this->language = $request->input('language', '');

        $this->city = $request->input('city', '');

        $this->province = $request->input('province', '');

        $this->country = $request->input('country', '');

        $this->avatarUrl = $request->input('avatarUrl', '');

        $this->loginSession = $request->input('loginSession', '');

        $this->cafe_id = $request->input('cafe_id', '');

        $this->is_follow = $request->input('is_follow', '');

        $this->partner_id = $request->input('partner_id', 0);

        $this->user_id = $request->input('user_id', 0);

        $this->limit = $request->input('limit', 0);

        $this->nickname = $request->input('nickname', '');

        $this->mobile = $request->input('mobile', '');

        $this->id = $request->input('id', 0);

        $this->role_list = $request->input('role_list', '');
        $this->path = $request->input('path', '');
        $this->menu_id_str = $request->input('menu_id_str', '');
        $this->key = $request->input('key', '');
        $this->page = $request->input('page', '');
        $this->scene = $request->input('scene', '');
        $this->cash_coupon_id = $request->input('cash_coupon_id', 0);
        $this->city_id = $request->input('city_id', 0);
        $this->mark_id = $request->input('mark_id', 0);
        $this->start_date = $request->input('start_date', '');
        $this->end_date = $request->input('end_date', '');
        $this->dynamic_id = $request->input('dynamic_id', 0);
    }
}